-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implementing bundle feature #694
Conversation
Codecov ReportBase: 67.92% // Head: 67.17% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #694 +/- ##
==========================================
- Coverage 67.92% 67.17% -0.76%
==========================================
Files 114 117 +3
Lines 6619 6790 +171
Branches 1157 1179 +22
==========================================
+ Hits 4496 4561 +65
- Misses 2123 2229 +106
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@sudhirverma which issue this PR is related to? |
this PR will fix #695 |
@sudhirverma is the PR ready for review or you need to add some more features to it ? |
I am still working on it. I will add you as a reviewer when this PR is ready. |
8e8e437
to
bd378df
Compare
Step to test this PR, enable Screen.Recording.2022-10-31.at.11.33.20.PM.mov |
@sudhirverma Provide the registry username/password also in the same form. User need not go to switch the workflow. All Qs should be in the same form and once user clicks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Started playing with it.
-
I faced this error when clicking on submit.
The other annoying part is that the webview closes and when i reopen it the form is blank so i need to re-fill it to re-try deploying it. An idea could be to close the webview only if the deploy is successful -
If i click on the bundle action multiple time the webview gets opened in multiple tabs. Wouldn't it be enough to only have one webview opened? I don't think anybody is going to create 2 bundles at the same time.
-
(person taste) isn't the webview too white compared to the vscode theme? The first time I opened it i got blind 😆
-
The autocomplete item (= tekton resources) has one subtle issue. If you have two resources of different type with the same name you cannot add both of them.
-
It would be good if, once you choose a resource in the autocomplete list, this gets removed from the list.
-
We should enable the submit button only if the image name has a valid format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I assume this PR is just for creating a new bundle and you're going to add the feature to download a bundle and allow users to import one or more resources contained in it in a new PR, right?
As a future enhancement, if it's possible to add multiple selection for the tekton resource dropdownlist would be great. When adding 10 resources it's an annoying process otherwise
Yes I will create a new PR.
Multiple selection is there when you press |
@sudhirverma for multi-select chip selection, this should work https://mui.com/material-ui/react-select/#chip. This should be quick to do. |
done |
@sudhirverma please add a gif of how the select chips look after the changes are done. And also how the submit button looks like. |
@mohitsuman attaching video 2022-11-16.23-20-50.mp4 |
@sudhirverma There are multiple CSS stuff which needs to be improved here.
For input box layout, refer to how we do in the OpenShift extension https://github.com/redhat-developer/vscode-openshift-tools/blob/main/src/webview/git-import/app/gitImport.tsx#L322 . This will help you to improve the CSS also. |
@mohitsuman Updated the PR adding gif also |
@mohitsuman done can you check |
@sudhirverma This PR fails if we try to run this on a connected OpenShift cluster. It asks for namespaces "tekton-pipelines". For OpenShift it should be the |
Ideally this is the place to update the feature flag: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple changes needs to be fixed. The most important one is support openshift-pipelines
namespace.
src/webview/bundle/Form.tsx
Outdated
<Typography variant="h5" > Create Bundle</Typography> | ||
</div> | ||
<div className='subTitle'> | ||
<Typography>This workflow will help to create a bundle and push it to remote registry.</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Typography>This workflow will help to create a bundle and push it to remote registry.</Typography> | |
<Typography>This workflow will help to create your own Tekton bundle, push it to the remote registry and reference that in your Tekton manifest. Before running this command make sure you are authenticated to the remote image registry and valid credentials are there in order to push to that registry.</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done I have changed the subtitle
src/webview/bundle/Form.tsx
Outdated
return ( | ||
<div className='mainContainer margin' > | ||
<div className='title'> | ||
<Typography variant="h5" > Create Bundle</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Typography variant="h5" > Create Bundle</Typography> | |
<Typography variant="h5" >Publish Tekton Resources as bundles on OCI registry</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done fix I have fixed the title
src/pipeline/bundle.ts
Outdated
BundleWizard.currentPanel.editor.reveal(column); | ||
return; | ||
} | ||
const bundleTitle = 'Create Bundle'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bundleTitle = 'Create Bundle'; | |
const bundleTitle = 'Create Tekton Bundle'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done the changes.
src/tekton/bundle-pipeline-task.ts
Outdated
const featureFlagData: FeatureFlag = await checkEnableApiFields(); | ||
if (!featureFlagData) return null; | ||
if (featureFlagData.data['enable-tekton-oci-bundles'] !== 'true') { | ||
window.showWarningMessage('To enable bundles change enable-tekton-oci-bundles to "true" in "feature-flags" ConfigMap namespace tekton-pipelines'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tekton-pipelines
should not be hardcoded. This can be for openshift-pipelines
also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the hardcoded. Now it will show warning message as per cluster.
src/tekton/bundle-pipeline-task.ts
Outdated
return await window.withProgress({title: 'Bundling image.....', location: ProgressLocation.Notification}, async () => { | ||
const result = await tkn.execute(Command.bundle(bundleInfo.imageDetail, `${quote}${fsPath}${quote}`, bundleInfo.userDetail, bundleInfo.passwordDetail), process.cwd(), false); | ||
if (result.error) { | ||
window.showErrorMessage(`Failed to push bundle error: ${getStderrString(result.error)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.showErrorMessage(`Failed to push bundle error: ${getStderrString(result.error)}`); | |
window.showErrorMessage(`Failed to push the bundle. Please check the following error: ${getStderrString(result.error)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the error message as per your suggestion.
src/webview/bundle/index.tsx
Outdated
const previousState = vscode.getState(); | ||
if (previousState) { | ||
ReactDOM.render( | ||
<React.StrictMode> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the App should work without StrictMode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed StrictMode
src/webview/bundle/style.scss
Outdated
|
||
.subTitle { | ||
margin-bottom: 2rem; | ||
max-width: 59rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
59 rem is too much of a max-width. It needs to be a percentage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using percentage now
margin-bottom: 2rem; | ||
max-width: 59rem; | ||
justify-content: center; | ||
word-spacing: 5px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either use rem
or px
. Do not use both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using percentage now
@@ -27,126 +27,126 @@ export interface TestRunnerOptions { | |||
|
|||
export class CoverageRunner { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sudhirverma Coverage fix should be in a different PR. It does not relate to this PR fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's needed to pass the build
package.json
Outdated
@@ -1056,6 +1072,9 @@ | |||
"ui-test": "extest setup-and-run ./out/ui-test/all.js" | |||
}, | |||
"devDependencies": { | |||
"@babel/core": "7.19.6", | |||
"@emotion/react": "^11.7.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this dependency needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@sudhirverma looks good to me. Just resolve the conflicts and we should be good to merge. @lstocchi can you please look at the bundle logic and approve? |
…nly one time in editor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix: #695
Fix: #699